//
//  BCOrderHistoryCommitCollectionViewCell.m
//  BangcaiBuy
//
//  Created by Liang Zhang on 16/7/4.
//  Copyright © 2016年 BCB. All rights reserved.
//

#import "BCOrderHistoryCommitCollectionViewCell.h"

@implementation BCOrderHistoryCommitCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    _commitButton.layer.cornerRadius = 3.f;
    NSMutableAttributedString *priceAttributedString = [[NSMutableAttributedString alloc] initWithString:_phoneLable.text];
    UIColor *titleColor = [UIColor lightGrayColor];
    UIColor *phoneColor = BangcaiGreen;
    [priceAttributedString addAttribute:NSForegroundColorAttributeName  //文字颜色
                                  value:titleColor
                                  range:NSMakeRange(0, @"客服热线：".length)];
    [priceAttributedString addAttribute:NSForegroundColorAttributeName  //文字颜色
                                  value:phoneColor
                                  range:NSMakeRange(@"客服热线：".length, @"400-0042-400".length)];
    _phoneLable.attributedText = priceAttributedString;
}

+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView {
    static NSString *ID = @"HistoryCommitCollectionViewCell";
    UINib *nib = [UINib nibWithNibName:@"BCOrderHistoryCommitCollectionViewCell" bundle: [NSBundle mainBundle]];
    [collectionView registerNib:nib forCellWithReuseIdentifier:ID];
    BCOrderHistoryCommitCollectionViewCell *cell = [[BCOrderHistoryCommitCollectionViewCell alloc] init];
    return cell;
}

- (IBAction)commitAction:(id)sender {
    _commit();
}

@end
